import 'package:seedfour/generated/json/base/json_convert_content.dart';
import 'package:seedfour/app/models/api_response/api_response_entity.dart';

ApiResponseError $ApiResponseErrorFromJson(Map<String, dynamic> json) {
  final ApiResponseError apiResponseError = ApiResponseError();
  final String? code = jsonConvert.convert<String>(json['code']);
  if (code != null) {
    apiResponseError.code = code;
  }
  final String? message = jsonConvert.convert<String>(json['message']);
  if (message != null) {
    apiResponseError.message = message;
  }
  return apiResponseError;
}

Map<String, dynamic> $ApiResponseErrorToJson(ApiResponseError entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['message'] = entity.message;
  return data;
}

extension ApiResponseErrorExtension on ApiResponseError {
  ApiResponseError copyWith({
    String? code,
    String? message,
  }) {
    return ApiResponseError()
      ..code = code ?? this.code
      ..message = message ?? this.message;
  }
}